package com.zh.controller.app;

import cn.dev33.satoken.annotation.SaIgnore;
import com.zh.pojo.dto.WxMinAppRegisterDto;
import com.zh.result.JSONResult;
import com.zh.service.ICustomerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Tag(name = "司机对象",description = "司机对象")
@RestController
@RequestMapping("/app/customer")
public class AppCustomerController {

    @Autowired
    public ICustomerService customerService;

    @Operation( summary= "小程序微信司机注册",description = "小程序微信司机注册接口")
    @Parameter(name = "driver",description = "注册的对象",required = true)
    @PostMapping("/wxregister")
    // 此接口加上了 @SaIgnore 可以游客访问
    @SaIgnore
    public JSONResult save(@RequestBody @Valid WxMinAppRegisterDto wxRegisterDto){
        customerService.wxregister(wxRegisterDto);
        return JSONResult.success();
    }



}
